﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_PrintOrder : ASPXBaseClass
{
    public string OrderId, RegionId, BusinessDistrictId, OfficeId, FloorId, Address, CustomerName, TelNum, OrderAmount, DeliveryDate, DeliveryPeriodId, PaymentType;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindRpt();
        }
    }

    void BindRpt()
    {
        Int64 Id = Convert.ToInt64(GZ.Common.HttpHelper.GetParameter("orderid", GZ.Common.HttpHelper.HttpType.GET));
        GZ.Entity.EOrder obj = new GZ.Entity.EOrder();
        System.Data.DataTable dt = obj.GetOrderPrintInfo(Id);
        if (dt.Rows.Count > 0)
        {
            OrderId = dt.Rows[0]["OrderId"].ToString();
            RegionId = dt.Rows[0]["RegionId"].ToString();
            BusinessDistrictId = dt.Rows[0]["BusinessDistrictId"].ToString();
            OfficeId = dt.Rows[0]["OfficeId"].ToString();
            FloorId = dt.Rows[0]["FloorId"].ToString();
            Address = dt.Rows[0]["Address"].ToString();
            CustomerName = dt.Rows[0]["CustomerName"].ToString();
            TelNum = dt.Rows[0]["TelNum"].ToString();
            OrderAmount = dt.Rows[0]["OrderAmount"].ToString();
            DeliveryDate = Convert.ToDateTime(dt.Rows[0]["DeliveryDate"]).ToString("yyyy-MM-dd");
            DeliveryPeriodId = dt.Rows[0]["DeliveryPeriodId"].ToString();
            PaymentType = dt.Rows[0]["PaymentType"].ToString();
        }
        GZ.Entity.EOrderDetail od = new GZ.Entity.EOrderDetail();
        this.rptOrderList.DataSource = od.GetOrderDetail(Id);
        this.rptOrderList.DataBind();
    }
}